using System;
using System.Collections.Generic;
using System.Text;
using Plossum.CommandLine;

namespace AKJ.Sharepoint.SPConstantGen
{
    [CommandLineManager(ApplicationName = "SPConstantGen", Copyright = "Copyright (c) Anders Jacobsen")]
    [CommandLineOptionGroup("Tester")]
    class CmdOptions
    {
        [CommandLineOption(Description = "Displays this help text",GroupId="Tester")]        
        public bool Help = false;

        [CommandLineOption(Description = "The URL of the target site", MinOccurs = 1)]
        public string Url
        {
            get { return mUrl; }
            set
            {
                if (String.IsNullOrEmpty(value))
                    throw new InvalidOptionValueException(
                        "The name must not be empty", false);
                mUrl = value;
            }
        }

        [CommandLineOption(Description = "The Path where the generated file is placed (Deafult is same as executable)", MinOccurs = 0, DefaultAssignmentValue = "", RequireExplicitAssignment = true)]
        public string Path
        {
            get { return mPath; }
            set
            {
                if (value == null)
                    throw new InvalidOptionValueException(
                        "The name must not be empty", false);
                mPath = value;
            }
        }

        [CommandLineOption(Description = "The Namespace used in the generated file (Default is 'AKJ.Sharepoint').", MinOccurs = 0, DefaultAssignmentValue = "AKJ.Sharepoint", RequireExplicitAssignment = true)]
        public string Namespace
        {
            get { return mNamespace; }
            set
            {
                if (value == null)
                    throw new InvalidOptionValueException(
                        "The name must not be empty", false);
                mNamespace = value;
            }
        }

        [CommandLineOption(Description = "[True:False]. If set or True the generated class will be outputted to screen. Can be VERY long!).", MinOccurs = 0, DefaultAssignmentValue = false, RequireExplicitAssignment = true)]
        public bool Verbose
        {
            get { return mVerbose; }
            set { mVerbose = value; }            
        }

        private bool mVerbose;
        private string mNamespace;
        private string mPath;
        private string mUrl;
        private string mName;
    }
}
